/**
 * Created by Administrator on 2017/2/11.
 */
import { Component } from '@angular/core';
import { ForService } from './forgotpassword.serve';
import { Router, ActivatedRoute, Params } from '@angular/router';

@Component({
    moduleId: module.id,
    selector: 'my-password',
    templateUrl: 'password.html',
    providers:[ForService]
})

export class PasswordComponent {
    constructor(
        private ForService:ForService,
        private route: ActivatedRoute,
        private router: Router,
    ) {}
    public  name1:string='';
    public  name2:string='';
    public sgin='';
    public errMessage:string;
    private ware=true;
    sendEmail (email:string) {
        if (!email) { return; }
        this.ForService.finder(email)
            .subscribe(
                res => {this.sgin=res['status']; let stu = this.sgin ;
                if(stu=="00"){
                  this.router.navigate(['/linkReset',email]);
                  this.ware=true
                }else {
                  this.name2='该邮箱并未注册';
                  this.ware=false;
                }
                },
                error =>  this.errMessage = <any>error);
        console.log(this.sgin)
    }
}
